from sqlalchemy import Column, String, Float, Integer
from sqlalchemy.ext.declarative import declarative_base

__author__ = 'Jeremysan'

Base = declarative_base()


class VillageBasic(Base):
    __tablename__ = 'bk_village'

    # 小区id
    id = Column(String, primary_key=True)
    # 小区名称
    name = Column(String)
    # 行政区
    district = Column(String)
    # 商圈
    bizcircle = Column(String)
    # 平均价
    avgPrice = Column(String)
    # 在售套数
    onSale = Column(Integer)

    @staticmethod
    def tranfer(row):
        village = VillageBasic()
        village.id = row['id']
        village.name = row['name']
        village.district = row['district']
        village.bizcircle = row['bizcircle']
        village.avgPrice = row['avgPrice']
        village.onSale = row['onSale']
        return village

